$(function () {
  axios.defaults.baseURL = 'http://124.223.14.236:3001/api'
  const form = document.querySelector("#content form");
  form.addEventListener("submit", async function (e) {
    e.preventDefault()
    const { data: { data: res } } = await axios.post('/user/login', {
      username: $('#username').val(),
      password: $('#password').val(),
    })
    console.log(res)
    localStorage.setItem("token", res.token)
    localStorage.setItem("id", res.id)
    alert("登录成功:我已经将token存在本地存储中了哦")
  })

})